#nullable enable

using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace PHMEE.EnergyEfficiency;

public interface IBunkerReportRepository
{
    Task<BunkerReport?> GetAsync(Guid vesselId, DateTime dateTimeUtc);

    /// <summary>
    /// 计数，时间前闭后开区间
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="startDateTimeUtc"></param>
    /// <param name="endDateTimeUtc"></param>
    /// <returns></returns>
    Task<int> CountAsync(Guid vesselId, DateTime startDateTimeUtc, DateTime endDateTimeUtc);

    /// <summary>
    /// 时间前闭后开区间查询，按 Ts DESC 排序
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="startDateTimeUtc"></param>
    /// <param name="endDateTimeUtc"></param>
    /// <param name="skipCount"></param>
    /// <param name="maxResultCount"></param>
    /// <returns></returns>
    Task<List<BunkerReport>> GetListDescAsync(Guid vesselId, DateTime startDateTimeUtc,
        DateTime endDateTimeUtc, int skipCount, int maxResultCount);

    /// <summary>
    /// 获取（不根据设备 id 筛选） [startTime, endTime) 之间的记录（不包括 Tags 的值，只包含表的列），按时间从早到晚顺序
    /// </summary>
    /// <param name="vesselId">船舶 Id，用于确定数据库名</param>
    /// <param name="startTime"></param>
    /// <param name="endTime"></param>
    /// <returns></returns>
    Task<List<BunkerReport>> GetListASCAsync(Guid vesselId, DateTime startTime, DateTime endTime);

    /// <summary>
    /// 插入数据
    /// </summary>
    /// <param name="bunkerReport"></param>
    /// <param name="vesselId"></param>
    Task InsertAsync(BunkerReport bunkerReport, Guid vesselId);

    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="vesselId"></param>
    /// <param name="ts"></param>
    Task DeleteAsync(Guid vesselId, DateTime ts);
}